%ratio = after/before
function [ratio] = CompRatio(data)
    %quantitize to 256 colors
    [reduced,map]= rgb2ind(data,256);
    %denoise
    reduced = medfilt2(reduced,[3,3]);    
    %imshow(reduced,map);
    
    %compress data
    compData = dzip(reduced);
    data = data(:);
    ratio = size(compData)/size(data);